{extend name="layouts/main" /}
{block name="link"}{/block}
{block name="content"}
<div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
	<div class="layui-body layui-tab-content site-demo site-demo-body" style="top: 0px;left: 0px;">
		<div class="layui-tab-item layui-show">
			<div class="layui-main">
				<div id="LAY_preview">
					<blockquote class="layui-elem-quote layui-text" style="margin-bottom: 5px;">
						<i class="fa fa-home"></i>
						<span class="layui-breadcrumb">
							<a><cite>系统主页</cite></a>
							<a><cite>联动类别</cite></a>
						</span>
					</blockquote>
					<div class="layui-fluid" style="position: relative;margin: 0 auto;padding: 0 0px;">
						<div class="layui-set">
							<div class="layui-set-from search-form">
								<form class="layui-form" action="">
									<div class="layui-form-item" style="margin-bottom: -8px;">
										<div class="layui-input-inline" style="margin-right: 5px;">
											<select name="model_id" lay-verify="required">
												<option value="" selected="selected">全部</option>
												{volist name="$model" id="vo"}
												<option value="{$vo.id}">{$vo.title}</option>
												{/volist}
											</select>
										</div>
										<div class="layui-input-inline" style="margin-right: 5px;">
											<input type="text" name="title" value="{:input('title')}"  placeholder="搜索关键词" autocomplete="off" class="layui-input search-input">
										</div>
										<div class="layui-input-inline" style="width:80px">
											<button class="layui-btn" id="search" style="height: 36px;"><i class="layui-icon"></i></button>
										</div>
									</div>
								</form>
							</div>
						</div>
						<div class="layui-card" style="overflow-y: hidden;float: left;width: 100%;">
							<form class="layui-form" action="">
								<table class="layui-table" lay-filter="tableEvent">
									<colgroup>
										<col width="1">
										<col>
										<col>
										<col>
										<col width="8%">
										<col width="20%">
									</colgroup>
									<thead>
										<tr>
											<th>ID</th>
											<th>联动标题(字段标题)</th>
											<th>联动标识(字段名称)</th>
											<th>所属模型</th>
											<th>状态</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>
										{volist name="list" id="info"}
										<tr>
											<td>{$info.id}</td>
											<td><a href="{:url('list_select',array('tid'=>$info['id'],'pid'=>0))}">{$info.title}</a></td>
											<td>{$info.name}</td>
											<td>{$info.model}</td>
											<td>正常</td>
											<td>
												<div class="layui-inline"><a class="layui-btn layui-btn-xs " href="{:url('add',array('tid'=>$info['id'],'pid'=>0))}"><i class="layui-icon layui-icon-edit"></i> 添加子分类</a></div>
												<div class="layui-inline"><a class="layui-btn layui-btn-xs " href="{:url('list_select',array('tid'=>$info['id'],'pid'=>0))}"><i class="layui-icon layui-icon-edit"></i> 查看子分类</a></div>
											</td>
										</tr>
										{/volist}
									</tbody>
								</table>
							</form>
							<div id="page">
								<div class="layui-box layui-laypage layui-laypage-default">
									<div class="pagelistbox">
										{$list|raw}
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
{/block}
{block name="js"}
<script type="text/javascript">
	$(function() {
        $("select[name='model_id']").val({$model_id|default = ''});
    });
</script>
{/block}